package com.sinodata.bsm.center.web.action.resource;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.sinodata.bsm.center.service.relation.ResRelationService;
import com.sinodata.bsm.center.service.resource.ResService;
import com.sinodata.bsm.center.service.resource.ResViewService;
import com.sinodata.bsm.center.util.web.Struts2Utils;
import com.sinodata.bsm.center.web.action.BaseAction;
import com.sinodata.bsm.common.vo.*;

public class ResStrategyAction extends BaseAction<Res> {
    @Autowired
    private ResViewService resViewService;

    @Autowired
    private ResService resService;
    @Autowired
    private ResRelationService resRelationService;
    private String id;
    public final static int NODE_TYPE_RESOURCE = 2;
    public final static int NODE_TYPE_RESTYPE = 3;

    @Override
    public String delete() throws Exception {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public String input() throws Exception {
        // TODO Auto-generated method stub
        return null;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String saveCurrentMenu() throws Exception {
        String menuId = request.getParameter("menuId");
        String type = request.getParameter("type");
        if (type.equals("2")) {
            request.getSession().setAttribute("last-res-strategy-menu", menuId);
        } else {
            request.getSession().setAttribute("last-type-strategy-menu", menuId);
        }
        return null;
    }

    @Override
    public String execute() throws Exception {

        return SUCCESS;
    }

    @Override
    protected void prepareModel() throws Exception {
        // TODO Auto-generated method stub

    }

    @Override
    public String save() throws Exception {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Res getModel() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public String list() throws Exception {
        // TODO Auto-generated method stub
        return null;
    }

}
